package com.runvp.common.model.tcp;

import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.ToString;

/**
 * 响应消息实体
 */
@Getter
@ToString
public class MessageResBody extends MessageParseBody {


    private static final long serialVersionUID = 4866778988304763271L;

    private Long deviceId;
    /**
     * 报文数据主体
     */
    private String bodys;
    /**
     * 报文数据主体
     */
    private JSONObject bodyJson;

    public MessageResBody setDeviceId(Long deviceId) {
        this.deviceId = deviceId;
        return this;
    }

    public MessageResBody setBodyJson(JSONObject bodyJson) {
        this.bodyJson = bodyJson;
        super.setBody(encBody(bodyJson));
        return this;
    }

    public MessageResBody setBodys(String bodys) {
        this.bodys = bodys;
        return this;
    }

    public MessageResBody() {
        super();
    }
    public MessageResBody(String head) {
        this.setHead(head);
    }
    public MessageResBody(String type, String cmd) {
        super(type, cmd);
    }
}
